{% load staticfiles %}
{% load i18n %}
<html>
<head>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="robots" content="NONE,NOARCHIVE">
    <title>用户登录 - SimpleBlog</title>
    <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{% static 'css/bootstrap-theme.min.css' %}">
    <link rel="stylesheet" href="{% static 'css/login.css' %}">
    <script src="{% static 'js/jquery-1.11.1.min.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
    <script src="{% static 'js/base.js' %}"></script>
</head>
<body class="login">
<div class="container">
    <div class="panel panel-default panel-single form-login" id="panel-login">
        <div class="panel-heading">
            <h2 class="form-signin-heading">请登录</h2>
        </div>
        <div class="panel-body">
            <form method="post" action="{% url 'django.contrib.auth.views.login' %}">
                {% csrf_token %}
                {% if form.errors %}
                <div id="error_msg" class="form-group has-error" style="padding-left: 15px;">
                    <p id="error_{{ forloop.counter }}_{{ field.auto_id }}"
                       class="text-danger help-block">用户名/密码不正确，请重新输入！</p>
                </div>
                {% endif %}
                <div id="div_id_username" class="form-group">
                    <div class="controls clearfix">
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon"><i class="fa fa-user fa-fw"></i></span>
                            <input class="form-control input-lg" id="id_username" maxlength="254"
                                   name="username" type="text" placeholder="用户名">
                        </div>
                    </div>
                </div>
                <div id="div_id_password" class="form-group">
                    <div class="controls clearfix">
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span>
                            <input class="form-control input-lg" id="id_password" name="password"
                                   type="password" placeholder="密码">
                        </div>
                    </div>
                </div>
                <input type="hidden" name="this_is_the_login_form" value="1"/>
                <input type="hidden" name="next" value="{{ next }}"/>
                <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
                <div class="text-info" style="margin-top:15px;">
                    <a href="{% url 'django.contrib.auth.views.password_reset' %}">
                        <i class="fa fa-question-sign"></i>忘记了您的密码或用户名？</a>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- /container -->

<script type="text/javascript">
    document.getElementById('id_username').focus()
</script>

</body>
</html>